package com.astrakit.common.api;

/**
 * Created with IntelliJ IDEA.
 * Description:做渐进主义的改良派,不做完没注意的速成派
 * User: XALEXC
 * Date: 2025-08-20
 * Time: 21:19
 */

public enum ErrorCode {
    SUCCESS(0, "ok"),
    PARAMS_ERROR(400, "请求参数错误"),
    UNAUTHORIZED(401, "未认证"),
    FORBIDDEN(403, "无权限"),
    NOT_FOUND(404, "接口不存在"),
    SERVER_ERROR(500, "服务器内部错误"),
    BUSINESS_ERROR(1000, "业务异常");

    private final int code;
    private final String msg;

    ErrorCode(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
